﻿<!DOCTYPE html>
<html lang="zh">

<head resource>
  <include file="../inc/meta.inc" />
  <title>功能菜单</title>
</head>

<body>
  <div id="app" v-cloak>
    <div class="toolsbar">
      <btngroup show="新增,修改,删除" ref='btngroup' @delete="deleteData" path="MenurootModify" width="600" height="400"
        :selects='selects' idkey='MM_Id' table="datatables"></btngroup>
    </div>
    <template>
      <el-table ref="datatables" :data="datas" tooltip-effect="dark" style="width: 100%" v-loading="loading"
        @selection-change="val=>selects=val" @row-dblclick="rowdblclick" row-key="MM_Id"
        :row-class-name="data=>{return data.row.MM_IsUse ? 'enable' : 'disabled';}" draggable>
        <el-table-column type="selection" width="35" show-overflow-tooltip>
        </el-table-column>
        <el-table-column type="index" width="50">
        </el-table-column>
        <el-table-column label="菜单树名称" width="120">
          <template slot-scope="scope">

            <icon v-if="scope.row.MM_IcoS==null || scope.row.MM_IcoS==''">&#xa038;</icon>
            <icon v-else v-html="'&#x'+scope.row.MM_IcoS+';'"></icon>
            <span v-html='scope.row.MM_Name' class="draghandle"></span> <span class="red" v-if="scope.row.MM_IsFixed"
              title="系统级菜单">*</span>
          </template>
        </el-table-column>
        <el-table-column prop="MM_Marker" label="标识" show-overflow-tooltip width="120">
          <template slot-scope="scope">{{scope.row.MM_Marker}}
          </template>
        </el-table-column>
        <el-table-column prop="MM_Intro" label="说明" show-overflow-tooltip>
          <template slot-scope="scope">{{scope.row.MM_Intro}}
          </template>
        </el-table-column>
        <el-table-column label="管理" width="80">
          <template slot-scope="scope">
            <el-link type="primary" plain icon="el-icon-edit"
              @click="$refs.btngroup.pagebox('Menutree?uid='+scope.row.MM_UID,'“'+scope.row.MM_Name+'”的子菜单',null,'800px','80%')">
              管理树</el-link>
          </template>
        </el-table-column>
        <el-table-column label="启用" width="80">
          <template slot-scope="scope">
            <span class="el-icon-loading" v-show="loadingid==scope.row.MM_Id"></span>
            <el-switch v-model="scope.row.MM_IsUse" :disabled="scope.row.MM_IsFixed" title="系统级菜单，必须启用"
              @change="changeUse(scope.row)" v-show="loadingid!=scope.row.MM_Id">
            </el-switch>
          </template>
        </el-table-column>

        <el-table-column label="操作" show-overflow-tooltip width="120">

          <el-button-group slot-scope="scope">
            <el-link type="primary" plain icon="el-icon-edit" @click='$refs.btngroup.modify(scope.row.MM_Id)'>修改
            </el-link>
            <el-popconfirm title="确定删除吗？" @confirm="$refs.btngroup.delete(scope.row.MM_Id,{})">
              <el-link type="danger" plain icon="el-icon-delete" :disabled="scope.row.MM_IsFixed" title="系统级菜单，不可删除"
                slot="reference">删除 </el-link>
            </el-popconfirm>
          </el-button-group>
        </el-table-column>
      </el-table>

    </template>

  </div>

</body>

</html>